var path = require("path");
var config = require("./config.json");

config.root_dir = global.server_root = __dirname;

if(process.argv[2] == "dev"){
    config.development = true;
}

var server = require("./lib/express-server")(config);

var platform_list = ["home"];
platform_list.forEach(function(app_name){
    server.load_platform(app_name,__dirname);
});


var app_list = ["apply"];
app_list.forEach(function(app_name){
    server.load_app(app_name,__dirname);
});


server.start();